package cn.iocoder.yudao.wallet.config;


import cn.iocoder.yudao.wallet.entity.Coin;
import cn.iocoder.yudao.wallet.entity.WatcherSetting;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自动配置币种参数
 */
@Slf4j
@AutoConfiguration
@ConditionalOnProperty(name = "coin.name")
public class CoinConfig {

    @Bean
    @ConfigurationProperties(prefix = "coin")
    public Coin getCoin(){
        Coin coin = new Coin();
        log.info("[初始化]Coin=======");
        return coin;
    }

    @Bean
    @ConfigurationProperties(prefix = "watcher")
    public WatcherSetting getWatcherSetting(){
        WatcherSetting watcherSetting = new WatcherSetting();
        log.info("[初始化]WatcherSetting=======");
        return watcherSetting;
    }

}
